import React, { PureComponent } from 'react';

export default class CounterButton extends PureComponent {
    constructor(props) {
        super(props);
        this.state = {count: 1};
      }
    
    render() {
        return (
            <button
                color={this.props.color}
                onClick={() => this.setState(state => ({count: state.count + 1}))}>
                Count: {this.state.count}
            </button>
        );
    }
}
